# -*- encoding:utf-8 -*-
# 开发团队：大数据组
# 开发者：albert·bing
# 开发时间：2020/7/5 20:13
# 文件名称：yellow_calendar.py
# 开发工具：PyCharm


#  start your code

# import sys
# sys.path.append('/home/hadoop/programs/spider/WTP66_BigdataCrawler')


from selenium import webdriver
# 导入键盘操作的keys包
from selenium.webdriver.common.keys import Keys
# 导入chrome选项
from selenium.webdriver.chrome.options import Options

import TreadeMark.config as configs

import json

from urllib.parse import quote
import TreadeMark.MySqlUtil as MySqlUtil

import requests
from bs4 import BeautifulSoup
import urllib3
import time

# 忽略https的安全警告
urllib3.disable_warnings()

# 创建driver
def create_driver():
    chrome_options = Options()
    chrome_options.add_argument('User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36')
    chrome_options.add_argument('Referer:www.quandashi.com')
    chrome_options.add_argument('cookie: NTKF_T2D_CLIENTID=guest9D076C7A-90BD-2142-451F-E699CC225146; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2217ae699d69fc62-002100befdeca-c3f3568-2073600-17ae699d6a0597%22%2C%22%24device_id%22%3A%2217ae699d69fc62-002100befdeca-c3f3568-2073600-17ae699d6a0597%22%2C%22props%22%3A%7B%7D%7D; INGRESSCOOKIE=1627387884.356.6100.309192; Hm_lvt_df2da21ec003ed3f44bbde6cbef22d1c=1627366477,1627369668,1627387884; _csrf=f56928aaad6710641d94eb6e911ba26a4647d0a6127fb15f1614491eb37b42a7a%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22w-_YUtV9x1RPsCGompFNOW_QktWF11Yo%22%3B%7D; PHPSESSID=303825b872529c6cb12746bf8812fa93; anonymousId=17ae699d69fc62-002100befdeca-c3f3568-2073600-17ae699d6a0597; QDS_COOKIE=user%3Ainfo%3A764B4371-56A7-957C-4DF8-2D2FBBE2E3B7; QDS_LOGIN_INFO=%7B%22userName%22%3A%22%5Cu672a%5Cu547d%5Cu540d%22%2C%22avtar%22%3A%22%22%7D; nTalk_CACHE_DATA={uid:kf_9479_ISME9754_guest9D076C7A-90BD-21,tid:1627542788807591}; uniqueCode=3EE2-01A2-9476-2150; Hm_lpvt_df2da21ec003ed3f44bbde6cbef22d1c=1627546071')
    chrome_options.add_argument('--headless')
    driver = webdriver.Chrome(executable_path=configs._CHROME_DRIVER_WIN, options=chrome_options)
    # driver = webdriver.Chrome(executable_path="", options=chrome_options)
    return driver

def get_source_data(driver):
    driver.get("https://www.quandashi.com/customer-clue/reject#")
    soup = BeautifulSoup(driver.page_source, "html.parser")
    print(soup)


if __name__ == '__main__':
    driver = create_driver()
    get_source_data(driver=driver)